import java.util.Objects;

public class Teacher {
    private String name;
    private int age;
    private int work;

    public Teacher(String name, int age, int work) {
        this.name = name;
        this.age = age;
        this.work = work;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public int getWork() {
        return work;
    }

    public void setWork(int work) {
        this.work = work;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Teacher teacher = (Teacher) o;
        return age == teacher.age &&
                work == teacher.work &&
                Objects.equals(name, teacher.name);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, age, work);
    }

}
class TestTeacher{
    public static void main(String[] args) {
        Teacher s1=new Teacher("张三",18,20000);
        Teacher s2=new Teacher("张三",18,20000);
        if (s1.equals(s2)){
            System.out.println("姓名："+s1.getName()+"年龄："+s1.getAge()+"工资："+s1.getWork());
        }
    }
}